/**
 *  描述：Global filters js
 */
// import tool from '@/js/core/utils/tool';

// 待安装
const install = (Vue, options) => {
  Vue.prototype._filters = {
    // 性别
    sex: (h, params, key) => {
      let strInfo = '';
      if (!params.row[key]) {
        return '';
      }
      switch (params.row[key].toString()) {
        case '0':
          strInfo = '未知';
          break;
        case '1':
          strInfo = '男';
          break;
        case '2':
          strInfo = '女';
          break;
        case '9':
          strInfo = '其他';
          break;
      }
      return h('p', strInfo);
    },
    // 状态
    enableFlag: (h, params, key) => {
      let strInfo = '';
      switch (params.row[key]) {
        case 1:
          strInfo = '正常';
          break;
        case 0:
          strInfo = '停用';
          break;
      }
      return h('p', strInfo);
    }
  };
};

export default install;
